goog.provide('lfpug.ui.renderer.StoryRenderer');
goog.require('goog.functions');
goog.require('lfpug.ui.Renderer');
goog.require('lfpug.ui.type.Template');
goog.require('templates.lfpug.ui.component.StoryComponent');



/**
 * @constructor
 * @extends {lfpug.ui.Renderer}
 */
lfpug.ui.renderer.StoryRenderer = function() {
  goog.base(this);
};
goog.inherits(
    lfpug.ui.renderer.StoryRenderer,
    lfpug.ui.Renderer
);
goog.addSingletonGetter(lfpug.ui.renderer.StoryRenderer);


/**
 * Custom CSS Class.
 * @const
 * @type {string}
 */
lfpug.ui.renderer.StoryRenderer.CSS_CLASS =
    goog.getCssName('story-component');


/** @override */
lfpug.ui.renderer.StoryRenderer.prototype.getCssClass =
    goog.functions.constant(
    lfpug.ui.renderer.StoryRenderer.CSS_CLASS);


/**
 * @const
 * @type {lfpug.ui.type.Template}
 */
lfpug.ui.renderer.StoryRenderer.TEMPLATE =
    /** @type {lfpug.ui.type.Template} */
    (templates.lfpug.ui.component.StoryComponent.Structure);


/** @override */
lfpug.ui.renderer.StoryRenderer.prototype.getTemplate =
    goog.functions.constant(
    lfpug.ui.renderer.StoryRenderer.TEMPLATE);


/**
 * TODO Note here that this is overriden for complex objects containing
 * children
 * @override
 */
lfpug.ui.renderer.StoryRenderer.prototype.getContentElement =
    function(rootElement) {
  var tasksContainer = goog.getCssName('tasks-container');
  var element = goog.dom.getElementByClass(tasksContainer, rootElement);
  return element;
};


/**
 * @override
 */
lfpug.ui.renderer.StoryRenderer.prototype.getTemplateObject =
    function(contest) {
  var object = goog.base(this, 'getTemplateObject', contest);
  var model = contest.getModel();
  object.Name = model.getName();
  object.Description = model.getDescription();
  return object;
};


